using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter12
{
	/// <summary>
	/// Example02: A Weighted Hand
	/// A person holds a 50.5 N sphere in his hand. 
	/// The forearm is horizontal, as shown in Figure 12.9a. 
	/// The biceps muscle is attached 3.00 cm from the joint, 
	/// and the sphere is 35.0 cm from the joint. Find the 
	/// upward force exerted by the biceps on the forearm 
	/// and the downward force exerted by the upper arm on 
	/// the forearm and acting at the joint. Neglect the weight 
	/// of forearm.
	/// F = 583 N
	/// </summary>
	public class Example02
	{
		public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Force[] f = new L.Force[3];
			L.Position[] r = new L.Position[3];
			f[0] = new L.Force();
			f[0].YVariableQ = true;
			f[1] = new L.Force();
			f[1].YVariableQ = true;
			f[2] = new L.Force();
			f[2].Y = -50.0;

			r[0] = new L.Position();
			r[1] = new L.Position();
			r[1].X = 0.03;
			r[2] = new L.Position();
			r[2].X = 0.35;

			L.RigidBody arm = new L.RigidBody();
			arm.SolveStaticEquilibrium(r,f);
			
			result+=Convert.ToString(f[0].Y)+"\r\n";
			result+=Convert.ToString(f[1].Y)+"\r\n";
		}
	}
}
